﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using V5_Common;
using V5_BLL;

namespace V5_EShop._Template.Default
{
    public partial class product_comment : BasicPage
    {
        protected int pid = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                pid = Input.SetInt(Request.QueryString["pid"]);
                Action = Input.SetString(Request.QueryString["action"]);
                switch (Action)
                {
                    case "go":
                        this.MultiViewList.ActiveViewIndex = 1;
                        //检查权限
                        if (!this.check_member_login())
                        {
                            Response.Redirect("/login.aspx?returnurl="+HTTPS.GetCurrentUrl());
                        }
                        break;
                    default:
                        Bind_rpList();
                        break;
                }
            }
        }

        private void Bind_rpList()
        {
            this.MultiViewList.ActiveViewIndex = 0;
            int count=0;

            this.rpList.DataSource = new BLLProductComment().GetList(Pager.PageSize,
                Pager.CurrentPageIndex,
                "",
                ref count);
            this.Pager.RecordCount = count;

            this.rpList.DataBind();
        }

        protected void Pager_PageChanged(object sender, EventArgs e)
        {
            this.Bind_rpList();
        }
    }
}
